package aboutme.felipesilvestre.oracaolista;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class SplashScreenActivity extends Activity {
	
	protected boolean active = true;
	protected int splashTime = 3000;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splashscreen);
        
        Thread splashThread = new Thread(){
        	
        	@Override
        	public void run(){

        		try{
        			
        			int waited = 0;
        			while(active && waited < splashTime){
        				sleep(100);
        				if(active){
        					waited += 100;
        				}
        			}
        		} catch(InterruptedException e){
        			
        		} finally {
        			
        			finish();
        			startActivity(new Intent(getBaseContext() ,MenuPrincipalActivity.class));
        			stop();
        			
        		}
        		
        		
        	}
        };
        
        splashThread.start();
        
    }
}